//
//  GQHOwnerAuthorizationInfoController.m
//  Xanthium
//
//  Created by GuanQinghao on 31/03/2018.
//  Copyright © 2018 GuanQinghao. All rights reserved.
//

#pragma mark Macro
#import "GQHHeader.h"

#pragma mark Model

#pragma mark Object

#pragma mark View
#import "GQHOwnerAuthorizationInfoView.h"

#pragma mark Controller
#import "GQHOwnerAuthorizationInfoController.h"

#pragma mark CocoaPods

#pragma mark ----------Header End----------

@interface GQHOwnerAuthorizationInfoController () {
    
#pragma mark Data
    NSMutableArray *contentArray;
#pragma mark View
    /// 自定义根视图
    GQHOwnerAuthorizationInfoView *rootView;
}

@end


@implementation GQHOwnerAuthorizationInfoController

#pragma mark --Lifecycle
- (void)loadView {
    DLog();
    
    rootView = [[GQHOwnerAuthorizationInfoView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.view = rootView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    DLog();
    
    [self loadLocalData];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    DLog();
    
    self.qh_titleLabel.text = @"货主认证信息";
    [self.qh_rightButton setHidden:YES];
    self.automaticallyAdjustsScrollViewInsets = NO;
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    DLog();
    
}

#pragma mark --Delegate

#pragma mark --TargetMethod

#pragma mark --PrivateMethod
- (void)loadLocalData {
    
    contentArray = [NSMutableArray arrayWithCapacity:20];
    
    // 联系人
    NSString *empName = [_qh_authorizationInfo objectForKey:@"empName"];
    [contentArray qh_safetySetObject:empName atIndex:0];
    
    // 联系电话
    NSString *phoneNum = [_qh_authorizationInfo objectForKey:@"phoneNum"];
    [contentArray qh_safetySetObject:phoneNum atIndex:1];
    
    // 身份证正面
    NSString *positiveIdCard = [NSString stringWithFormat:@"%@%@",[NSString qh_imageURLString],[_qh_authorizationInfo objectForKey:@"positiveIdCard"]];
    [contentArray qh_safetySetObject:positiveIdCard atIndex:2];
    
    // 身份证反面
    NSString *backIdCard = [NSString stringWithFormat:@"%@%@",[NSString qh_imageURLString],[_qh_authorizationInfo objectForKey:@"backIdCard"]];
    [contentArray qh_safetySetObject:backIdCard atIndex:3];
    
    rootView.qh_contentArray = contentArray;
    [rootView.qh_tableView reloadData];
}
#pragma mark --Setter

#pragma mark --Getter

#pragma mark --View

@end
